package com.vcc.service.service;


import cn.hutool.core.date.DateTime;
import com.alibaba.fastjson2.JSONObject;
import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.service.IService;
import com.vcc.data.entity.Role;
import com.vcc.data.entity.User;
import com.vcc.service.client.dto.user.ExternalUserRegisterDto;
import com.vcc.service.boss.request.user.UserRegisterDto;

import java.util.Collection;
import java.util.List;
import java.util.Map;

public interface UserService extends IService<User> {

    User getById(Long id);

    String getAccountById(Long userId);

    Boolean existsByAccount(String account);

    List<Long> listByDealerId(Long dealerId);

    List<String> listAccountByIds(Collection<Long> ids);

    User login(String account);

    User login(String account, String password);

    User init(UserRegisterDto userRegisterDto, Long dealerId);

    User init(ExternalUserRegisterDto userRegisterDto);

    boolean updateStatusById(Long id, Integer status);

    boolean bossUpdateStatusById(Long id, Integer status);

    boolean updateStatusByParentId(Long parentId, Integer status);

    boolean updatePayPasswordById(Long id, String payPassword);

    boolean updatePasswordById(Long id, String password);

    boolean updateRemarkById(Long id, String remark);

    boolean updateAdminRemarkById(Long id, String remark);

    List<Long> listIds();

    List<User> listDealer();

    List<User> listByEmail(String email, Long userId, Role role);

    List<User> listByEmail(String email);


    User getByEmail(String email);

    Page<User> paging(Page<User> pageable, Long userId, Role role, Long targetUserId, Integer status, String remark);

    Page<User> paging(Page<User> pageable, Long targetUserId, Integer status, String remark, String account, String email, Long dealerId, String sorter, Long parentId);


    Long getParentIdById(Long id);

    Long getDealerIdById(Long id);

    Boolean active(Long id);

    Boolean existsById(Long id);

    Boolean bindGoogle(Long id, String googleSecret);

    Boolean clearGoogle(Long id);

    Integer getStatusById(Long id);

    Long countByParentId(Long parentId);

    List<JSONObject> statistics();

    List<JSONObject> statistics(DateTime startDate, DateTime endDate);

    Integer statistics(List<String> dates);

    Boolean setInvitationCode(Long id, String invitationCode);

    Boolean existsByInvitationCode(String invitationCode);

    Long getIdByInvitationCode(String invitationCode);

    Boolean updateStatusAndAdminRemarkById(Long id, Integer status, String remark);

    Long countByRegisterId(Long registerId);

    Map<String, Long> userSummary();
}
